package com.office.meeting.video.service.impl;

import java.util.List;

import com.office.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.office.meeting.video.mapper.VideoConferenceMapper;
import com.office.meeting.video.domain.VideoConference;
import com.office.meeting.video.service.IVideoConferenceService;

/**
 * 视频会议Service业务层处理
 *
 * @author 柒月
 * @date 2025-05-23
 */
@Service
public class VideoConferenceServiceImpl implements IVideoConferenceService {
    @Autowired
    private VideoConferenceMapper videoConferenceMapper;


    /**
     * 查询视频会议列表
     *
     * @param videoConference 视频会议
     * @return 视频会议
     */
    @Override
    public List<VideoConference> selectVideoConferenceList(VideoConference videoConference) {
        // 获取当前登录用户
        Long loginUserId = SecurityUtils.getUserId();

        return videoConferenceMapper.selectVideoConferenceList(videoConference, loginUserId);
    }


    /**
     * @param id       会议的id号
     * @param password 会议的密码
     */
    @Override
    public VideoConference selectVideoConferenceById(Long id, String password) {
        VideoConference videoConference = videoConferenceMapper.selectVideoConferenceById(id,password);
        if (videoConference == null) {
            return null;
        }
        return videoConference;
    }
}
